package io.renren.modules.newBackground.shanghaiCmcc.v2.example;


import io.renren.modules.newBackground.shanghaiCmcc.v2.client.OpenapiHttpCilent;

public class TestMain {
	
	public static int count = 0;
	
	public static void main(String[] args) {
		
		
		/*for(int i = 1;i<3;i++) {
			Thread thread = new Thread(new ThreadMain(i));
			
			thread.start();
		}*/
		OpenapiHttpCilent client = new OpenapiHttpCilent("A0000186", "46vag3mn9M0srWuiMny64Pf3XacB8WFi");
		//OpenapiHttpCilent client = new OpenapiHttpCilent("A0000110", "jOAlfGs3+/3OjJ1kGrnq/ian4JH7HLq1");
		try {
			for(int i = 0;i < 1; i++) {
				String response = client.call("Test", "transactionId" + i,"{\"a\":\"1\"}");
				System.out.println("线程"+i+" 第"+i+"次调用;结果: "+response);	
				synchronized (TestMain.class) {
					TestMain.count++;
					System.out.println(TestMain.count);
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		/*SimpleDateFormat formatterHour = new SimpleDateFormat("yyyy-MM-dd HH");
		Calendar calendar = Calendar.getInstance();
		calendar.set(Calendar.YEAR, Integer.parseInt("2019"));
		calendar.set(Calendar.MONTH, Integer.parseInt("02")-1);
		calendar.set(Calendar.DATE, Integer.parseInt("28"));
		
		calendar.set(Calendar.HOUR_OF_DAY, 0);
		String startDate = formatterHour.format(calendar.getTime());
		System.out.println("startDate: " + startDate);
		calendar.set(Calendar.HOUR_OF_DAY, 24);
		String endDate = formatterHour.format(calendar.getTime());
		System.out.println("startDate: " + endDate);*/
	}

}
